Conversation
d84ac81 to
ba02048
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a statistics reporting tool (ais-stats) to collect and display I/O performance metrics for the hipFile library. The implementation uses shared memory and Unix domain sockets to communicate statistics between the monitored process and the reporting tool.
Changes:
- Added
ais-statscommand-line tool to launch programs and collect their I/O statistics - Implemented
StatsServerclass that maintains statistics in shared memory and serves them via Unix sockets - Integrated statistics tracking into fastpath and fallback I/O backends
- Added system call wrappers for
memfd_createandftruncateto support shared memory functionality
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/ais-stats/ais-stats.cpp | Command-line tool that launches or attaches to processes to collect statistics |
| tools/ais-stats/CMakeLists.txt | Build configuration for the ais-stats tool |
| src/amd_detail/stats.h | Statistics data structures and API definitions |
| src/amd_detail/stats.cpp | Core statistics implementation with shared memory and socket communication |
| src/amd_detail/sys.h | Added system call wrappers for memfd_create and ftruncate |
| src/amd_detail/sys.cpp | Implementation of new system call wrappers |
| src/amd_detail/backend/fastpath.cpp | Integrated statistics tracking for fast path I/O operations |
| src/amd_detail/backend/fallback.cpp | Integrated statistics tracking for fallback path I/O operations |
| src/amd_detail/CMakeLists.txt | Added stats.cpp to build |
| test/amd_detail/stats.cpp | Unit tests for statistics functionality |
| test/amd_detail/msys.h | Added mock methods for new system calls |
| test/amd_detail/CMakeLists.txt | Added stats test file to build |
| util/format-source.sh | Added tools directory to code formatting |
| CMakeLists.txt | Added option and build support for tools |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sbates130272
approved these changes
Feb 23, 2026
Collaborator
sbates130272
left a comment
There was a problem hiding this comment.
@zbyrne some minor comments. Looks good to me!
820a521 to
bdf21ee
Compare
riley-dixon
reviewed
Feb 27, 2026
42639aa to
1d4ce78
Compare
jordan-turbofish
approved these changes
Mar 4, 2026
The Stats struct will eventually be stored in a shared memory backed, mmapped file that can accessed from another process (ais-stats) to generate a report.
The cmsg code is based on examples from the man page.
More example cmsg code and a very simple report forthe tracked counters.
ais-stats uses StatsClient to connect to a process running a StatsServer either by launching the process or taking the PID of a running process from the command line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
AIHIPFILE-53 Infinity Storage as a storage solution must have sufficient performance counters & statistics for proper debugging, system component workflow understanding, and performance troubleshooting.
Technical Details
Counters are stored in a shared-memory-backed mmapped buffer as an array of atomic_uint64_ts. The library uses unix sockets and control messages to communicate the fd for the buffer with the reporting app.
Test Plan
Unit tests were added for some simple behaviors. Additionally, the example program aiscp was launched by ais-stats and IO stats were reported.
Test Result
$ ctest . -R 'HipFileStats*'
Test project /home/AMD/zbyrne/git/hipFile/build
Start 412: HipFileStats.statsAddFastPathRead
1/6 Test #412: HipFileStats.statsAddFastPathRead ........ Passed 0.02 sec
Start 413: HipFileStats.statsAddFastPathWrite
2/6 Test #413: HipFileStats.statsAddFastPathWrite ....... Passed 0.02 sec
Start 414: HipFileStats.statsAddFallbackPathRead
3/6 Test #414: HipFileStats.statsAddFallbackPathRead .... Passed 0.02 sec
Start 415: HipFileStats.statsAddFallbackPathWrite
4/6 Test #415: HipFileStats.statsAddFallbackPathWrite ... Passed 0.02 sec
Start 416: HipFileStats.StatsServerLifetime
5/6 Test #416: HipFileStats.StatsServerLifetime ......... Passed 0.02 sec
Start 417: HipFileStats.GenerateReportV1
6/6 Test #417: HipFileStats.GenerateReportV1 ............ Passed 0.02 sec
100% tests passed, 0 tests failed out of 6
$ build/tools/ais-stats/ais-stats build/examples/aiscp/aiscp README.md /home/AMD/zbyrne/README.md
Total fast path reads (B): 0
Total fast path writes (B):0
Total fallback path reads (B): 1729
Total fallback path writes (B): 524288
Submission Checklist